//
//  AXFFreshOrderViewController.m
//  aixinfeng005
//
//  Created by zhanghaifeng on 16/10/10.
//  Copyright © 2016年 BBSWaitting. All rights reserved.
//

#import "AXFFreshOrderViewController.h"
#import "XDCycleView.h"


@interface AXFFreshOrderViewController ()

@end

@implementation AXFFreshOrderViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    //添加导航控制器的title 254 210 0
    self.navigationController.navigationBar.barTintColor = [UIColor colorWithRed:254/250.0 green:210/255.0 blue:0 alpha:1];
    
    UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"title_1"]];
    
    [self.navigationController.view addSubview:imageView];
    
    [imageView mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.left.offset(120);
        make.right.offset(-120);
        make.top.offset(25);
        make.height.offset(25);
    
    }];
    
    
    //创建导航控制器上的右边按钮
    UIBarButtonItem *barBtn = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemSearch target:self action:@selector(jump)];
    
    barBtn.tintColor = [UIColor blackColor];
    
    self.navigationItem.rightBarButtonItem = barBtn;
    
    
    //创建headerview视图
    UIView *headerView= [[UIView alloc]init];
    headerView.frame=CGRectMake(0, 0, self.view.bounds.size.width, 300);
    headerView.backgroundColor=[UIColor darkGrayColor];
    [self.view addSubview:headerView];
    self.tableView.tableHeaderView=headerView;
    

    //添加图片轮播器到头部视图
    XDCycleView *cycleView = [[XDCycleView alloc] initWithFrame:CGRectZero];
    
    [headerView addSubview:cycleView];
    
    [cycleView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.top.equalTo(headerView).offset(0);
        make.height.offset(150);
    }];
    
    cycleView.imageArr = [self loadImagesData];
}

#pragma mark-push页面
- (void)jump {
    
    
}

#pragma mark-头部视图



#pragma mark-数据源方法

//- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
//
//    return 10;
//}
//
//- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
//    
//    return 6;
//    
//}
//
//
//- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
//
//    return nil;
//

//}






//轮播器数据源接口
- (NSArray *)loadImagesData {
    NSMutableArray *arrM = [NSMutableArray array];
    for (NSInteger i = 0; i < 5; i++) {
        NSString *imageName = [NSString stringWithFormat:@"Home_Scroll_%02zd", i + 1];
        [arrM addObject:[UIImage imageNamed:imageName]];
    }
    return arrM;
    
}



@end




















